package com.zlcx.tz.live.constant;

/**
 * Created by ajGeGe
 */
public enum ResultStatus {

    SUCCESS("success", "成功", 0),
    FAILED("failed", "未知错误", 1),
    NO_AUTH("no_auth", "没有权限访问", 10401),
    DEL_TARGET_ERROR("正在学习中不能删除目标，请结束学习后再试", "正在学习中不能删除目标，请结束学习后再试",11013),
    TARGET_ERROR("请先选择目标", "请先选择目标",21013),
    UN_VIP("UN_VIP", "不是VIP用户", 19050),
    IMAGE_VIOLATION("IMAGE_VIOLATION", "图片内容可能包含违规内容，请更换后再发表", 14001),
    REQUEST_LIMIT("RequestLimit", "操作太频繁", 17401),
    PARAMS_ERROR("ParamsError", "参数不正确", 17400),
    BUSINESS_ERROR("BusinessError", "操作失败", 17500),
    VIDEO_LIMIT_ERROR("BusinessError", "该版本已经停止连麦服务，请下载最新版本APP！", 18000),
    LIVE_NUMS_USE_ERROR("free nums is used", "每天免费机会已使用", 19000),
    NO_VIP_CREATE_ROOM_ERROR("no vip not allowed create room", "非vip会员不能创建房间", 19001),
    NO_VIP_APPLY_ROOM_ERROR("no vip not allowed apply room", "该房间只允许vip会员申请上麦", 19002),
    VIP_USE_OVER_ERROR("vip times is over", "连麦时长已用尽", 19003),
    NO_EXISTS_ROOM("目前房间位置为0，快去连麦开个房间吧~", "目前房间位置为0，快去连麦开个房间吧~", 19004),
    TIME_LEARN_ROOM_SEAT_USED("计时自习室座位已经被占用", "计时自习室座位已经被占用", 19501),
    TIME_LEARN_ROOM_SEAT_UNCHECK("计时自习室座位不合法", "计时自习室座位不合法", 19502),
    TIME_LEARN_ROOM_NO_THIS_USER("计时自习室没有该用户", "计时自习室没有该用户", 19503),
    TIME_LEARN_ROOM_SEAT_NO_THIS_USER("计时自习室座位上没有该用户", "计时自习室座位上没有该用户", 19504),
    TIME_LEARN_ROOM_LEARNING("用户在计时自习室学习中", "用户在计时自习室学习中", 19505),
    TIME_LEARN_ROOM_SEAT_IS_FULL("计时自习室座位已满", "计时自习室座位已满", 19506),
    TIME_LEARN_ROOM_IS_FULL("计时自习室用户已满", "计时自习室用户已满", 19510),
    ;

    ResultStatus(String info, String tips, int code) {
        this.info = info;
        this.tips = tips;
        this.code = code;
    }

    private String info;
    private String tips;
    public int code;

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public static ResultStatus getFormIdStatusByCode(int code) {
        for (ResultStatus field : ResultStatus.values()) {
            if (code == field.getCode()) {
                return field;
            }
        }
        return null;
    }
}
